<template>
	<el-container>
		<el-header>
			<div class="left-panel">
				<el-date-picker v-model="date" type="datetimerange" range-separator="至" start-placeholder="开始日期"
					end-placeholder="结束日期" @change="changeDate"></el-date-picker>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable ref="table" :apiObj="apiObj" :params="params" orderBy="sort" row-key="id"
				@selection-change="selectionChange" stripe :hideDo="true">
				<sc-table-column label="序号" type="index"></sc-table-column>
				<sc-table-column label="业务名称" prop="description" min-width="140"></sc-table-column>
				<!-- <sc-table-column label="用户id" prop="id" min-width="280"></sc-table-column> -->
				<sc-table-column label="登录IP" prop="ip" width="150"></sc-table-column>
				<sc-table-column label="是否成功" prop="success" width="150" align="center">
					<template #default="scope">
						<el-tag v-if="scope.row.success" type="success">成功</el-tag>
						<el-tag v-else type="danger">失败</el-tag>
					</template>
				</sc-table-column>
				<sc-table-column label="登录时间" prop="lastModifyTime" min-width="150"></sc-table-column>

			</scTable>
		</el-main>
	</el-container>

</template>

<script>
	export default {
		name: 'loginlog',
		data() {
			return {
				itemList: [],
				params: {
					keyword: '',
					sort: ''
				},
				date: [],
				apiObj: this.$API.system.log.login,
				searchData: {
					startDate: "",
					endDate: ''
				}
			}
		},
		methods: {
			changeDate(e) {
				if (e) {
					this.searchData.startDate = e[0]
					this.searchData.endDate = e[1]
				} else {
					this.searchData.startDate = ''
					this.searchData.endDate = ''
				}

				this.$refs.table.upData(this.searchData)
			},
			//搜索
			upsearch() {
				this.$refs.table.upData(this.searchData)
			},
			selectionChange() {

			}
		}
	}
</script>

<style>
</style>
